package com.qwz.learn;

/**
 * @Description: 简单工厂的实现类
 * @Author: Qiuwuzhi
 * @CreateDate: 2019/12/12  10:16
 * @Version V1.0
 */
public class SimpleFactory {

    public static SimpleApi createApi(int type) {
        SimpleApi api;
        switch (type) {
            case 1:
                api = new ApiA();
                break;
            case 2:
                api = new ApiB();
                break;
            default:
                api = null;

        }
        return api;
    }
}
